#ifndef VIRTUALFSSESSION_H
#define VIRTUALFSSESSION_H

#include <QString>
#include "virtualfs.h"

class VirtualFsSession
{
public:
    VirtualFsSession();

    void setSessionFile(const QString & f);

    const QString & sessionFile() {
        return _file;
    }

    int saveSession(VirtualFs *fs);
    int restoreSession(VirtualFs *fs);
    void dump(const QString & fname);


private:
    void dump_help(QFile &file);
    int recursiveFindAndRead(QFile & file, VirtualFs *fs, VirtualFsObject *fs_o);
    int recursiveFindAndWrite(QFile & file, VirtualFsObject *fs);
    int writeInfo(QFile & file, VirtualFsObject *fs_obj);
    int endFolder(QFile & file);

private:
    QString _file;
};

#endif // VIRTUALFSSESSION_H
